﻿using System;
using System.Data;
using System.Text;
using System.Data.OracleClient;
using DBUtility;//Please add references
namespace DataAccess
{
    /// <summary>
    /// 数据访问类:TB_CHECK_HS
    /// </summary>
    public partial class TB_CHECK_HS
    {
        public TB_CHECK_HS()
        { }
        #region  Method

        /// <summary>
        /// 获取记录数
        /// </summary>
        /// <param name="strWhere"></param>
        /// <returns></returns>
        public static int GetCount(string strWhere)
        {
            StringBuilder strSql = new StringBuilder();
            strSql.Append("select count(1) num ");
            strSql.Append(" FROM TB_CHECK_HS ");
            if (strWhere.Trim() != "")
            {
                strSql.Append(" where " + strWhere);
            }
            object obj = DbHelperOra.GetSingle(strSql.ToString());
            return int.Parse(obj.ToString());
        }

        /// <summary>
        /// 是否存在该记录
        /// </summary>
        public static bool Exists(decimal NID)
        {
            StringBuilder strSql = new StringBuilder();
            strSql.Append("select count(1) from TB_CHECK_HS");
            strSql.Append(" where NID=:NID ");
            OracleParameter[] parameters = {
					new OracleParameter(":NID", OracleType.Number,22)};
            parameters[0].Value = NID;

            return DbHelperOra.Exists(strSql.ToString(), parameters);
        }
        /// <summary>
        /// 是否存在该记录
        /// </summary>
        public static bool Exists(string SQDH)
        {
            StringBuilder strSql = new StringBuilder();
            strSql.Append("select count(1) from TB_CHECK_HS");
            strSql.Append(" where SQDH=:SQDH ");
            OracleParameter[] parameters = {
					new OracleParameter(":SQDH", OracleType.NVarChar)};
            parameters[0].Value = SQDH;

            return DbHelperOra.Exists(strSql.ToString(), parameters);
        }

        /// <summary>
        /// 增加一条数据
        /// </summary>
        public static bool Add(Model.TB_CHECK_HS model)
        {
            model.NID = CommonExecute.GetID(model.GetType().Name);
            StringBuilder strSql = new StringBuilder();
            strSql.Append("insert into TB_CHECK_HS(");
            strSql.Append("NID,SQDH,CSQMC,YPSFKD,TSFHHTYQ,YPSL,BQFHYQ,MLGSFHYQ,SJZLFHYQ,SQFWWCQKT,HXXPJHT,XPZXDJHT,XPZXDZB,ZLYJS,HSYJSCS,JDB,HSJSSJS,HSFXJL,HSJQPW,HSZLSSBG,SSPS_XPS_YZ,HSYJLSJ_CLSJ,FZSY_CLBG,CPZJBG,ZLYJS_YZ,ZLYJS_FS,ZZZLYJS_YW,ZZZLYJS_FS,JC_DATE,LSH,JCSFTG,RKZT,CREATE_USER,CREATE_DATE)");
            strSql.Append(" values (");
            strSql.Append(":NID,:SQDH,:CSQMC,:YPSFKD,:TSFHHTYQ,:YPSL,:BQFHYQ,:MLGSFHYQ,:SJZLFHYQ,:SQFWWCQKT,:HXXPJHT,:XPZXDJHT,:XPZXDZB,:ZLYJS,:HSYJSCS,:JDB,:HSJSSJS,:HSFXJL,:HSJQPW,:HSZLSSBG,:SSPS_XPS_YZ,:HSYJLSJ_CLSJ,:FZSY_CLBG,:CPZJBG,:ZLYJS_YZ,:ZLYJS_FS,:ZZZLYJS_YW,:ZZZLYJS_FS,:JC_DATE,:LSH,:JCSFTG,:RKZT,:CREATE_USER,:CREATE_DATE)");
            OracleParameter[] parameters = {
					new OracleParameter(":NID", OracleType.Number,10),
					new OracleParameter(":SQDH", OracleType.NVarChar),
					new OracleParameter(":CSQMC", OracleType.NVarChar),
					new OracleParameter(":YPSFKD", OracleType.Number,1),
					new OracleParameter(":TSFHHTYQ", OracleType.Number,1),
					new OracleParameter(":YPSL", OracleType.Number,10),
					new OracleParameter(":BQFHYQ", OracleType.Number,1),
					new OracleParameter(":MLGSFHYQ", OracleType.Number,1),
					new OracleParameter(":SJZLFHYQ", OracleType.Number,1),
					new OracleParameter(":SQFWWCQKT", OracleType.Number,1),
					new OracleParameter(":HXXPJHT", OracleType.Number,1),
					new OracleParameter(":XPZXDJHT", OracleType.Number,1),
					new OracleParameter(":XPZXDZB", OracleType.Number,1),
					new OracleParameter(":ZLYJS", OracleType.Number,1),
					new OracleParameter(":HSYJSCS", OracleType.Number,1),
					new OracleParameter(":JDB", OracleType.Number,1),
					new OracleParameter(":HSJSSJS", OracleType.Number,1),
					new OracleParameter(":HSFXJL", OracleType.Number,1),
					new OracleParameter(":HSJQPW", OracleType.Number,1),
					new OracleParameter(":HSZLSSBG", OracleType.Number,1),
					new OracleParameter(":SSPS_XPS_YZ", OracleType.Number,1),
					new OracleParameter(":HSYJLSJ_CLSJ", OracleType.Number,1),
					new OracleParameter(":FZSY_CLBG", OracleType.Number,1),
					new OracleParameter(":CPZJBG", OracleType.Number,1),
					new OracleParameter(":ZLYJS_YZ", OracleType.Number,1),
					new OracleParameter(":ZLYJS_FS", OracleType.Number,10),
					new OracleParameter(":ZZZLYJS_YW", OracleType.Number,1),
					new OracleParameter(":ZZZLYJS_FS", OracleType.Number,10),
					new OracleParameter(":JC_DATE", OracleType.DateTime),
					new OracleParameter(":LSH", OracleType.Number,10),
					new OracleParameter(":JCSFTG", OracleType.Number,1),
					new OracleParameter(":RKZT", OracleType.Number,1),
					new OracleParameter(":CREATE_USER", OracleType.NVarChar),
					new OracleParameter(":CREATE_DATE", OracleType.DateTime)};
            parameters[0].Value = model.NID;
            parameters[1].Value = model.SQDH;
            parameters[2].Value = model.CSQMC;
            parameters[3].Value = model.YPSFKD;
            parameters[4].Value = model.TSFHHTYQ;
            parameters[5].Value = model.YPSL;
            parameters[6].Value = model.BQFHYQ;
            parameters[7].Value = model.MLGSFHYQ;
            parameters[8].Value = model.SJZLFHYQ;
            parameters[9].Value = model.SQFWWCQKT;
            parameters[10].Value = model.HXXPJHT;
            parameters[11].Value = model.XPZXDJHT;
            parameters[12].Value = model.XPZXDZB;
            parameters[13].Value = model.ZLYJS;
            parameters[14].Value = model.HSYJSCS;
            parameters[15].Value = model.JDB;
            parameters[16].Value = model.HSJSSJS;
            parameters[17].Value = model.HSFXJL;
            parameters[18].Value = model.HSJQPW;
            parameters[19].Value = model.HSZLSSBG;
            parameters[20].Value = model.SSPS_XPS_YZ;
            parameters[21].Value = model.HSYJLSJ_CLSJ;
            parameters[22].Value = model.FZSY_CLBG;
            parameters[23].Value = model.CPZJBG;
            parameters[24].Value = model.ZLYJS_YZ;
            parameters[25].Value = model.ZLYJS_FS;
            parameters[26].Value = model.ZZZLYJS_YW;
            parameters[27].Value = model.ZZZLYJS_FS;
            parameters[28].Value = model.JC_DATE;
            parameters[29].Value = model.LSH;
            parameters[30].Value = model.JCSFTG;
            parameters[31].Value = model.RKZT;
            parameters[32].Value = model.CREATE_USER;
            parameters[33].Value = model.CREATE_DATE;

            int rows = DbHelperOra.ExecuteSql(strSql.ToString(), parameters);
            if (rows > 0)
            {
                return true;
            }
            else
            {
                return false;
            }
        }
        /// <summary>
        /// 更新一条数据
        /// </summary>
        public static bool Update(Model.TB_CHECK_HS model)
        {
            StringBuilder strSql = new StringBuilder();
            strSql.Append("update TB_CHECK_HS set ");
            strSql.Append("SQDH=:SQDH,");
            strSql.Append("CSQMC=:CSQMC,");
            strSql.Append("YPSFKD=:YPSFKD,");
            strSql.Append("TSFHHTYQ=:TSFHHTYQ,");
            strSql.Append("YPSL=:YPSL,");
            strSql.Append("BQFHYQ=:BQFHYQ,");
            strSql.Append("MLGSFHYQ=:MLGSFHYQ,");
            strSql.Append("SJZLFHYQ=:SJZLFHYQ,");
            strSql.Append("SQFWWCQKT=:SQFWWCQKT,");
            strSql.Append("HXXPJHT=:HXXPJHT,");
            strSql.Append("XPZXDJHT=:XPZXDJHT,");
            strSql.Append("XPZXDZB=:XPZXDZB,");
            strSql.Append("ZLYJS=:ZLYJS,");
            strSql.Append("HSYJSCS=:HSYJSCS,");
            strSql.Append("JDB=:JDB,");
            strSql.Append("HSJSSJS=:HSJSSJS,");
            strSql.Append("HSFXJL=:HSFXJL,");
            strSql.Append("HSJQPW=:HSJQPW,");
            strSql.Append("HSZLSSBG=:HSZLSSBG,");
            strSql.Append("SSPS_XPS_YZ=:SSPS_XPS_YZ,");
            strSql.Append("HSYJLSJ_CLSJ=:HSYJLSJ_CLSJ,");
            strSql.Append("FZSY_CLBG=:FZSY_CLBG,");
            strSql.Append("CPZJBG=:CPZJBG,");
            strSql.Append("ZLYJS_YZ=:ZLYJS_YZ,");
            strSql.Append("ZLYJS_FS=:ZLYJS_FS,");
            strSql.Append("ZZZLYJS_YW=:ZZZLYJS_YW,");
            strSql.Append("ZZZLYJS_FS=:ZZZLYJS_FS,");
            strSql.Append("JC_DATE=:JC_DATE,");
            strSql.Append("LSH=:LSH,");
            strSql.Append("JCSFTG=:JCSFTG,");
            strSql.Append("RKZT=:RKZT,");
            strSql.Append("CREATE_USER=:CREATE_USER,");
            strSql.Append("CREATE_DATE=:CREATE_DATE");
            strSql.Append(" where NID=:NID ");
            OracleParameter[] parameters = {
					new OracleParameter(":SQDH", OracleType.NVarChar),
					new OracleParameter(":CSQMC", OracleType.NVarChar),
					new OracleParameter(":YPSFKD", OracleType.Number,1),
					new OracleParameter(":TSFHHTYQ", OracleType.Number,1),
					new OracleParameter(":YPSL", OracleType.Number,10),
					new OracleParameter(":BQFHYQ", OracleType.Number,1),
					new OracleParameter(":MLGSFHYQ", OracleType.Number,1),
					new OracleParameter(":SJZLFHYQ", OracleType.Number,1),
					new OracleParameter(":SQFWWCQKT", OracleType.Number,1),
					new OracleParameter(":HXXPJHT", OracleType.Number,1),
					new OracleParameter(":XPZXDJHT", OracleType.Number,1),
					new OracleParameter(":XPZXDZB", OracleType.Number,1),
					new OracleParameter(":ZLYJS", OracleType.Number,1),
					new OracleParameter(":HSYJSCS", OracleType.Number,1),
					new OracleParameter(":JDB", OracleType.Number,1),
					new OracleParameter(":HSJSSJS", OracleType.Number,1),
					new OracleParameter(":HSFXJL", OracleType.Number,1),
					new OracleParameter(":HSJQPW", OracleType.Number,1),
					new OracleParameter(":HSZLSSBG", OracleType.Number,1),
					new OracleParameter(":SSPS_XPS_YZ", OracleType.Number,1),
					new OracleParameter(":HSYJLSJ_CLSJ", OracleType.Number,1),
					new OracleParameter(":FZSY_CLBG", OracleType.Number,1),
					new OracleParameter(":CPZJBG", OracleType.Number,1),
					new OracleParameter(":ZLYJS_YZ", OracleType.Number,1),
					new OracleParameter(":ZLYJS_FS", OracleType.Number,10),
					new OracleParameter(":ZZZLYJS_YW", OracleType.Number,1),
					new OracleParameter(":ZZZLYJS_FS", OracleType.Number,10),
					new OracleParameter(":JC_DATE", OracleType.DateTime),
					new OracleParameter(":LSH", OracleType.Number,10),
					new OracleParameter(":JCSFTG", OracleType.Number,1),
					new OracleParameter(":RKZT", OracleType.Number,1),
					new OracleParameter(":CREATE_USER", OracleType.NVarChar),
					new OracleParameter(":CREATE_DATE", OracleType.DateTime),
					new OracleParameter(":NID", OracleType.Number,10)};
            parameters[0].Value = model.SQDH;
            parameters[1].Value = model.CSQMC;
            parameters[2].Value = model.YPSFKD;
            parameters[3].Value = model.TSFHHTYQ;
            parameters[4].Value = model.YPSL;
            parameters[5].Value = model.BQFHYQ;
            parameters[6].Value = model.MLGSFHYQ;
            parameters[7].Value = model.SJZLFHYQ;
            parameters[8].Value = model.SQFWWCQKT;
            parameters[9].Value = model.HXXPJHT;
            parameters[10].Value = model.XPZXDJHT;
            parameters[11].Value = model.XPZXDZB;
            parameters[12].Value = model.ZLYJS;
            parameters[13].Value = model.HSYJSCS;
            parameters[14].Value = model.JDB;
            parameters[15].Value = model.HSJSSJS;
            parameters[16].Value = model.HSFXJL;
            parameters[17].Value = model.HSJQPW;
            parameters[18].Value = model.HSZLSSBG;
            parameters[19].Value = model.SSPS_XPS_YZ;
            parameters[20].Value = model.HSYJLSJ_CLSJ;
            parameters[21].Value = model.FZSY_CLBG;
            parameters[22].Value = model.CPZJBG;
            parameters[23].Value = model.ZLYJS_YZ;
            parameters[24].Value = model.ZLYJS_FS;
            parameters[25].Value = model.ZZZLYJS_YW;
            parameters[26].Value = model.ZZZLYJS_FS;
            parameters[27].Value = model.JC_DATE;
            parameters[28].Value = model.LSH;
            parameters[29].Value = model.JCSFTG;
            parameters[30].Value = model.RKZT;
            parameters[31].Value = model.CREATE_USER;
            parameters[32].Value = model.CREATE_DATE;
            parameters[33].Value = model.NID;

            int rows = DbHelperOra.ExecuteSql(strSql.ToString(), parameters);
            if (rows > 0)
            {
                return true;
            }
            else
            {
                return false;
            }
        }

        /// <summary>
        /// 删除一条数据
        /// </summary>
        public static bool Delete(decimal NID)
        {

            StringBuilder strSql = new StringBuilder();
            strSql.Append("delete from TB_CHECK_HS ");
            strSql.Append(" where NID=:NID ");
            OracleParameter[] parameters = {
					new OracleParameter(":NID", OracleType.Number,22)};
            parameters[0].Value = NID;

            int rows = DbHelperOra.ExecuteSql(strSql.ToString(), parameters);
            if (rows > 0)
            {
                return true;
            }
            else
            {
                return false;
            }
        }
        /// <summary>
        /// 批量删除数据
        /// </summary>
        public static bool DeleteList(string NIDlist)
        {
            StringBuilder strSql = new StringBuilder();
            strSql.Append("delete from TB_CHECK_HS ");
            strSql.Append(" where NID in (" + NIDlist + ")  ");
            int rows = DbHelperOra.ExecuteSql(strSql.ToString());
            if (rows > 0)
            {
                return true;
            }
            else
            {
                return false;
            }
        }


        /// <summary>
        /// 得到一个对象实体
        /// </summary>
        public static Model.TB_CHECK_HS GetModel(decimal NID)
        {

            StringBuilder strSql = new StringBuilder();
            strSql.Append("select NID,SQDH,CSQMC,YPSFKD,TSFHHTYQ,YPSL,BQFHYQ,MLGSFHYQ,SJZLFHYQ,SQFWWCQKT,HXXPJHT,XPZXDJHT,XPZXDZB,ZLYJS,HSYJSCS,JDB,HSJSSJS,HSFXJL,HSJQPW,HSZLSSBG,SSPS_XPS_YZ,HSYJLSJ_CLSJ,FZSY_CLBG,CPZJBG,ZLYJS_YZ,ZLYJS_FS,ZZZLYJS_YW,ZZZLYJS_FS,JC_DATE,LSH,JCSFTG,RKZT,CREATE_USER,CREATE_DATE from TB_CHECK_HS ");
            strSql.Append(" where NID=:NID ");
            OracleParameter[] parameters = {
					new OracleParameter(":NID", OracleType.Number,22)};
            parameters[0].Value = NID;

            Model.TB_CHECK_HS model = new Model.TB_CHECK_HS();
            DataSet ds = DbHelperOra.Query(strSql.ToString(), parameters);
            if (ds.Tables[0].Rows.Count > 0)
            {
                if (ds.Tables[0].Rows[0]["NID"] != null && ds.Tables[0].Rows[0]["NID"].ToString() != "")
                {
                    model.NID = decimal.Parse(ds.Tables[0].Rows[0]["NID"].ToString());
                }
                if (ds.Tables[0].Rows[0]["SQDH"] != null && ds.Tables[0].Rows[0]["SQDH"].ToString() != "")
                {
                    model.SQDH = ds.Tables[0].Rows[0]["SQDH"].ToString();
                }
                if (ds.Tables[0].Rows[0]["CSQMC"] != null && ds.Tables[0].Rows[0]["CSQMC"].ToString() != "")
                {
                    model.CSQMC = ds.Tables[0].Rows[0]["CSQMC"].ToString();
                }
                if (ds.Tables[0].Rows[0]["YPSFKD"] != null && ds.Tables[0].Rows[0]["YPSFKD"].ToString() != "")
                {
                    model.YPSFKD = decimal.Parse(ds.Tables[0].Rows[0]["YPSFKD"].ToString());
                }
                if (ds.Tables[0].Rows[0]["TSFHHTYQ"] != null && ds.Tables[0].Rows[0]["TSFHHTYQ"].ToString() != "")
                {
                    model.TSFHHTYQ = decimal.Parse(ds.Tables[0].Rows[0]["TSFHHTYQ"].ToString());
                }
                if (ds.Tables[0].Rows[0]["YPSL"] != null && ds.Tables[0].Rows[0]["YPSL"].ToString() != "")
                {
                    model.YPSL = decimal.Parse(ds.Tables[0].Rows[0]["YPSL"].ToString());
                }
                if (ds.Tables[0].Rows[0]["BQFHYQ"] != null && ds.Tables[0].Rows[0]["BQFHYQ"].ToString() != "")
                {
                    model.BQFHYQ = decimal.Parse(ds.Tables[0].Rows[0]["BQFHYQ"].ToString());
                }
                if (ds.Tables[0].Rows[0]["MLGSFHYQ"] != null && ds.Tables[0].Rows[0]["MLGSFHYQ"].ToString() != "")
                {
                    model.MLGSFHYQ = decimal.Parse(ds.Tables[0].Rows[0]["MLGSFHYQ"].ToString());
                }
                if (ds.Tables[0].Rows[0]["SJZLFHYQ"] != null && ds.Tables[0].Rows[0]["SJZLFHYQ"].ToString() != "")
                {
                    model.SJZLFHYQ = decimal.Parse(ds.Tables[0].Rows[0]["SJZLFHYQ"].ToString());
                }
                if (ds.Tables[0].Rows[0]["SQFWWCQKT"] != null && ds.Tables[0].Rows[0]["SQFWWCQKT"].ToString() != "")
                {
                    model.SQFWWCQKT = decimal.Parse(ds.Tables[0].Rows[0]["SQFWWCQKT"].ToString());
                }
                if (ds.Tables[0].Rows[0]["HXXPJHT"] != null && ds.Tables[0].Rows[0]["HXXPJHT"].ToString() != "")
                {
                    model.HXXPJHT = decimal.Parse(ds.Tables[0].Rows[0]["HXXPJHT"].ToString());
                }
                if (ds.Tables[0].Rows[0]["XPZXDJHT"] != null && ds.Tables[0].Rows[0]["XPZXDJHT"].ToString() != "")
                {
                    model.XPZXDJHT = decimal.Parse(ds.Tables[0].Rows[0]["XPZXDJHT"].ToString());
                }
                if (ds.Tables[0].Rows[0]["XPZXDZB"] != null && ds.Tables[0].Rows[0]["XPZXDZB"].ToString() != "")
                {
                    model.XPZXDZB = decimal.Parse(ds.Tables[0].Rows[0]["XPZXDZB"].ToString());
                }
                if (ds.Tables[0].Rows[0]["ZLYJS"] != null && ds.Tables[0].Rows[0]["ZLYJS"].ToString() != "")
                {
                    model.ZLYJS = decimal.Parse(ds.Tables[0].Rows[0]["ZLYJS"].ToString());
                }
                if (ds.Tables[0].Rows[0]["HSYJSCS"] != null && ds.Tables[0].Rows[0]["HSYJSCS"].ToString() != "")
                {
                    model.HSYJSCS = decimal.Parse(ds.Tables[0].Rows[0]["HSYJSCS"].ToString());
                }
                if (ds.Tables[0].Rows[0]["JDB"] != null && ds.Tables[0].Rows[0]["JDB"].ToString() != "")
                {
                    model.JDB = decimal.Parse(ds.Tables[0].Rows[0]["JDB"].ToString());
                }
                if (ds.Tables[0].Rows[0]["HSJSSJS"] != null && ds.Tables[0].Rows[0]["HSJSSJS"].ToString() != "")
                {
                    model.HSJSSJS = decimal.Parse(ds.Tables[0].Rows[0]["HSJSSJS"].ToString());
                }
                if (ds.Tables[0].Rows[0]["HSFXJL"] != null && ds.Tables[0].Rows[0]["HSFXJL"].ToString() != "")
                {
                    model.HSFXJL = decimal.Parse(ds.Tables[0].Rows[0]["HSFXJL"].ToString());
                }
                if (ds.Tables[0].Rows[0]["HSJQPW"] != null && ds.Tables[0].Rows[0]["HSJQPW"].ToString() != "")
                {
                    model.HSJQPW = decimal.Parse(ds.Tables[0].Rows[0]["HSJQPW"].ToString());
                }
                if (ds.Tables[0].Rows[0]["HSZLSSBG"] != null && ds.Tables[0].Rows[0]["HSZLSSBG"].ToString() != "")
                {
                    model.HSZLSSBG = decimal.Parse(ds.Tables[0].Rows[0]["HSZLSSBG"].ToString());
                }
                if (ds.Tables[0].Rows[0]["SSPS_XPS_YZ"] != null && ds.Tables[0].Rows[0]["SSPS_XPS_YZ"].ToString() != "")
                {
                    model.SSPS_XPS_YZ = decimal.Parse(ds.Tables[0].Rows[0]["SSPS_XPS_YZ"].ToString());
                }
                if (ds.Tables[0].Rows[0]["HSYJLSJ_CLSJ"] != null && ds.Tables[0].Rows[0]["HSYJLSJ_CLSJ"].ToString() != "")
                {
                    model.HSYJLSJ_CLSJ = decimal.Parse(ds.Tables[0].Rows[0]["HSYJLSJ_CLSJ"].ToString());
                }
                if (ds.Tables[0].Rows[0]["FZSY_CLBG"] != null && ds.Tables[0].Rows[0]["FZSY_CLBG"].ToString() != "")
                {
                    model.FZSY_CLBG = decimal.Parse(ds.Tables[0].Rows[0]["FZSY_CLBG"].ToString());
                }
                if (ds.Tables[0].Rows[0]["CPZJBG"] != null && ds.Tables[0].Rows[0]["CPZJBG"].ToString() != "")
                {
                    model.CPZJBG = decimal.Parse(ds.Tables[0].Rows[0]["CPZJBG"].ToString());
                }
                if (ds.Tables[0].Rows[0]["ZLYJS_YZ"] != null && ds.Tables[0].Rows[0]["ZLYJS_YZ"].ToString() != "")
                {
                    model.ZLYJS_YZ = decimal.Parse(ds.Tables[0].Rows[0]["ZLYJS_YZ"].ToString());
                }
                if (ds.Tables[0].Rows[0]["ZLYJS_FS"] != null && ds.Tables[0].Rows[0]["ZLYJS_FS"].ToString() != "")
                {
                    model.ZLYJS_FS = decimal.Parse(ds.Tables[0].Rows[0]["ZLYJS_FS"].ToString());
                }
                if (ds.Tables[0].Rows[0]["ZZZLYJS_YW"] != null && ds.Tables[0].Rows[0]["ZZZLYJS_YW"].ToString() != "")
                {
                    model.ZZZLYJS_YW = decimal.Parse(ds.Tables[0].Rows[0]["ZZZLYJS_YW"].ToString());
                }
                if (ds.Tables[0].Rows[0]["ZZZLYJS_FS"] != null && ds.Tables[0].Rows[0]["ZZZLYJS_FS"].ToString() != "")
                {
                    model.ZZZLYJS_FS = decimal.Parse(ds.Tables[0].Rows[0]["ZZZLYJS_FS"].ToString());
                }
                if (ds.Tables[0].Rows[0]["JC_DATE"] != null && ds.Tables[0].Rows[0]["JC_DATE"].ToString() != "")
                {
                    model.JC_DATE = DateTime.Parse(ds.Tables[0].Rows[0]["JC_DATE"].ToString());
                }
                if (ds.Tables[0].Rows[0]["LSH"] != null && ds.Tables[0].Rows[0]["LSH"].ToString() != "")
                {
                    model.LSH = decimal.Parse(ds.Tables[0].Rows[0]["LSH"].ToString());
                }
                if (ds.Tables[0].Rows[0]["JCSFTG"] != null && ds.Tables[0].Rows[0]["JCSFTG"].ToString() != "")
                {
                    model.JCSFTG = decimal.Parse(ds.Tables[0].Rows[0]["JCSFTG"].ToString());
                }
                if (ds.Tables[0].Rows[0]["RKZT"] != null && ds.Tables[0].Rows[0]["RKZT"].ToString() != "")
                {
                    model.RKZT = decimal.Parse(ds.Tables[0].Rows[0]["RKZT"].ToString());
                }
                if (ds.Tables[0].Rows[0]["CREATE_USER"] != null && ds.Tables[0].Rows[0]["CREATE_USER"].ToString() != "")
                {
                    model.CREATE_USER = ds.Tables[0].Rows[0]["CREATE_USER"].ToString();
                }
                if (ds.Tables[0].Rows[0]["CREATE_DATE"] != null && ds.Tables[0].Rows[0]["CREATE_DATE"].ToString() != "")
                {
                    model.CREATE_DATE = DateTime.Parse(ds.Tables[0].Rows[0]["CREATE_DATE"].ToString());
                }
                return model;
            }
            else
            {
                return null;
            }
        }
        /// <summary>
        /// 得到一个对象实体
        /// </summary>
        public static Model.TB_CHECK_HS GetModel(string SQDH)
        {

            StringBuilder strSql = new StringBuilder();
            strSql.Append("select NID,SQDH,CSQMC,YPSFKD,TSFHHTYQ,YPSL,BQFHYQ,MLGSFHYQ,SJZLFHYQ,SQFWWCQKT,HXXPJHT,XPZXDJHT,XPZXDZB,ZLYJS,HSYJSCS,JDB,HSJSSJS,HSFXJL,HSJQPW,HSZLSSBG,SSPS_XPS_YZ,HSYJLSJ_CLSJ,FZSY_CLBG,CPZJBG,ZLYJS_YZ,ZLYJS_FS,ZZZLYJS_YW,ZZZLYJS_FS,JC_DATE,LSH,JCSFTG,RKZT,CREATE_USER,CREATE_DATE from TB_CHECK_HS ");
            strSql.Append(" where SQDH=:SQDH ");
            OracleParameter[] parameters = {
					new OracleParameter(":SQDH", OracleType.Number,22)};
            parameters[0].Value = SQDH;

            Model.TB_CHECK_HS model = new Model.TB_CHECK_HS();
            DataSet ds = DbHelperOra.Query(strSql.ToString(), parameters);
            if (ds.Tables[0].Rows.Count > 0)
            {
                if (ds.Tables[0].Rows[0]["NID"] != null && ds.Tables[0].Rows[0]["NID"].ToString() != "")
                {
                    model.NID = decimal.Parse(ds.Tables[0].Rows[0]["NID"].ToString());
                }
                if (ds.Tables[0].Rows[0]["SQDH"] != null && ds.Tables[0].Rows[0]["SQDH"].ToString() != "")
                {
                    model.SQDH = ds.Tables[0].Rows[0]["SQDH"].ToString();
                }
                if (ds.Tables[0].Rows[0]["CSQMC"] != null && ds.Tables[0].Rows[0]["CSQMC"].ToString() != "")
                {
                    model.CSQMC = ds.Tables[0].Rows[0]["CSQMC"].ToString();
                }
                if (ds.Tables[0].Rows[0]["YPSFKD"] != null && ds.Tables[0].Rows[0]["YPSFKD"].ToString() != "")
                {
                    model.YPSFKD = decimal.Parse(ds.Tables[0].Rows[0]["YPSFKD"].ToString());
                }
                if (ds.Tables[0].Rows[0]["TSFHHTYQ"] != null && ds.Tables[0].Rows[0]["TSFHHTYQ"].ToString() != "")
                {
                    model.TSFHHTYQ = decimal.Parse(ds.Tables[0].Rows[0]["TSFHHTYQ"].ToString());
                }
                if (ds.Tables[0].Rows[0]["YPSL"] != null && ds.Tables[0].Rows[0]["YPSL"].ToString() != "")
                {
                    model.YPSL = decimal.Parse(ds.Tables[0].Rows[0]["YPSL"].ToString());
                }
                if (ds.Tables[0].Rows[0]["BQFHYQ"] != null && ds.Tables[0].Rows[0]["BQFHYQ"].ToString() != "")
                {
                    model.BQFHYQ = decimal.Parse(ds.Tables[0].Rows[0]["BQFHYQ"].ToString());
                }
                if (ds.Tables[0].Rows[0]["MLGSFHYQ"] != null && ds.Tables[0].Rows[0]["MLGSFHYQ"].ToString() != "")
                {
                    model.MLGSFHYQ = decimal.Parse(ds.Tables[0].Rows[0]["MLGSFHYQ"].ToString());
                }
                if (ds.Tables[0].Rows[0]["SJZLFHYQ"] != null && ds.Tables[0].Rows[0]["SJZLFHYQ"].ToString() != "")
                {
                    model.SJZLFHYQ = decimal.Parse(ds.Tables[0].Rows[0]["SJZLFHYQ"].ToString());
                }
                if (ds.Tables[0].Rows[0]["SQFWWCQKT"] != null && ds.Tables[0].Rows[0]["SQFWWCQKT"].ToString() != "")
                {
                    model.SQFWWCQKT = decimal.Parse(ds.Tables[0].Rows[0]["SQFWWCQKT"].ToString());
                }
                if (ds.Tables[0].Rows[0]["HXXPJHT"] != null && ds.Tables[0].Rows[0]["HXXPJHT"].ToString() != "")
                {
                    model.HXXPJHT = decimal.Parse(ds.Tables[0].Rows[0]["HXXPJHT"].ToString());
                }
                if (ds.Tables[0].Rows[0]["XPZXDJHT"] != null && ds.Tables[0].Rows[0]["XPZXDJHT"].ToString() != "")
                {
                    model.XPZXDJHT = decimal.Parse(ds.Tables[0].Rows[0]["XPZXDJHT"].ToString());
                }
                if (ds.Tables[0].Rows[0]["XPZXDZB"] != null && ds.Tables[0].Rows[0]["XPZXDZB"].ToString() != "")
                {
                    model.XPZXDZB = decimal.Parse(ds.Tables[0].Rows[0]["XPZXDZB"].ToString());
                }
                if (ds.Tables[0].Rows[0]["ZLYJS"] != null && ds.Tables[0].Rows[0]["ZLYJS"].ToString() != "")
                {
                    model.ZLYJS = decimal.Parse(ds.Tables[0].Rows[0]["ZLYJS"].ToString());
                }
                if (ds.Tables[0].Rows[0]["HSYJSCS"] != null && ds.Tables[0].Rows[0]["HSYJSCS"].ToString() != "")
                {
                    model.HSYJSCS = decimal.Parse(ds.Tables[0].Rows[0]["HSYJSCS"].ToString());
                }
                if (ds.Tables[0].Rows[0]["JDB"] != null && ds.Tables[0].Rows[0]["JDB"].ToString() != "")
                {
                    model.JDB = decimal.Parse(ds.Tables[0].Rows[0]["JDB"].ToString());
                }
                if (ds.Tables[0].Rows[0]["HSJSSJS"] != null && ds.Tables[0].Rows[0]["HSJSSJS"].ToString() != "")
                {
                    model.HSJSSJS = decimal.Parse(ds.Tables[0].Rows[0]["HSJSSJS"].ToString());
                }
                if (ds.Tables[0].Rows[0]["HSFXJL"] != null && ds.Tables[0].Rows[0]["HSFXJL"].ToString() != "")
                {
                    model.HSFXJL = decimal.Parse(ds.Tables[0].Rows[0]["HSFXJL"].ToString());
                }
                if (ds.Tables[0].Rows[0]["HSJQPW"] != null && ds.Tables[0].Rows[0]["HSJQPW"].ToString() != "")
                {
                    model.HSJQPW = decimal.Parse(ds.Tables[0].Rows[0]["HSJQPW"].ToString());
                }
                if (ds.Tables[0].Rows[0]["HSZLSSBG"] != null && ds.Tables[0].Rows[0]["HSZLSSBG"].ToString() != "")
                {
                    model.HSZLSSBG = decimal.Parse(ds.Tables[0].Rows[0]["HSZLSSBG"].ToString());
                }
                if (ds.Tables[0].Rows[0]["SSPS_XPS_YZ"] != null && ds.Tables[0].Rows[0]["SSPS_XPS_YZ"].ToString() != "")
                {
                    model.SSPS_XPS_YZ = decimal.Parse(ds.Tables[0].Rows[0]["SSPS_XPS_YZ"].ToString());
                }
                if (ds.Tables[0].Rows[0]["HSYJLSJ_CLSJ"] != null && ds.Tables[0].Rows[0]["HSYJLSJ_CLSJ"].ToString() != "")
                {
                    model.HSYJLSJ_CLSJ = decimal.Parse(ds.Tables[0].Rows[0]["HSYJLSJ_CLSJ"].ToString());
                }
                if (ds.Tables[0].Rows[0]["FZSY_CLBG"] != null && ds.Tables[0].Rows[0]["FZSY_CLBG"].ToString() != "")
                {
                    model.FZSY_CLBG = decimal.Parse(ds.Tables[0].Rows[0]["FZSY_CLBG"].ToString());
                }
                if (ds.Tables[0].Rows[0]["CPZJBG"] != null && ds.Tables[0].Rows[0]["CPZJBG"].ToString() != "")
                {
                    model.CPZJBG = decimal.Parse(ds.Tables[0].Rows[0]["CPZJBG"].ToString());
                }
                if (ds.Tables[0].Rows[0]["ZLYJS_YZ"] != null && ds.Tables[0].Rows[0]["ZLYJS_YZ"].ToString() != "")
                {
                    model.ZLYJS_YZ = decimal.Parse(ds.Tables[0].Rows[0]["ZLYJS_YZ"].ToString());
                }
                if (ds.Tables[0].Rows[0]["ZLYJS_FS"] != null && ds.Tables[0].Rows[0]["ZLYJS_FS"].ToString() != "")
                {
                    model.ZLYJS_FS = decimal.Parse(ds.Tables[0].Rows[0]["ZLYJS_FS"].ToString());
                }
                if (ds.Tables[0].Rows[0]["ZZZLYJS_YW"] != null && ds.Tables[0].Rows[0]["ZZZLYJS_YW"].ToString() != "")
                {
                    model.ZZZLYJS_YW = decimal.Parse(ds.Tables[0].Rows[0]["ZZZLYJS_YW"].ToString());
                }
                if (ds.Tables[0].Rows[0]["ZZZLYJS_FS"] != null && ds.Tables[0].Rows[0]["ZZZLYJS_FS"].ToString() != "")
                {
                    model.ZZZLYJS_FS = decimal.Parse(ds.Tables[0].Rows[0]["ZZZLYJS_FS"].ToString());
                }
                if (ds.Tables[0].Rows[0]["JC_DATE"] != null && ds.Tables[0].Rows[0]["JC_DATE"].ToString() != "")
                {
                    model.JC_DATE = DateTime.Parse(ds.Tables[0].Rows[0]["JC_DATE"].ToString());
                }
                if (ds.Tables[0].Rows[0]["LSH"] != null && ds.Tables[0].Rows[0]["LSH"].ToString() != "")
                {
                    model.LSH = decimal.Parse(ds.Tables[0].Rows[0]["LSH"].ToString());
                }
                if (ds.Tables[0].Rows[0]["JCSFTG"] != null && ds.Tables[0].Rows[0]["JCSFTG"].ToString() != "")
                {
                    model.JCSFTG = decimal.Parse(ds.Tables[0].Rows[0]["JCSFTG"].ToString());
                }
                if (ds.Tables[0].Rows[0]["RKZT"] != null && ds.Tables[0].Rows[0]["RKZT"].ToString() != "")
                {
                    model.RKZT = decimal.Parse(ds.Tables[0].Rows[0]["RKZT"].ToString());
                }
                if (ds.Tables[0].Rows[0]["CREATE_USER"] != null && ds.Tables[0].Rows[0]["CREATE_USER"].ToString() != "")
                {
                    model.CREATE_USER = ds.Tables[0].Rows[0]["CREATE_USER"].ToString();
                }
                if (ds.Tables[0].Rows[0]["CREATE_DATE"] != null && ds.Tables[0].Rows[0]["CREATE_DATE"].ToString() != "")
                {
                    model.CREATE_DATE = DateTime.Parse(ds.Tables[0].Rows[0]["CREATE_DATE"].ToString());
                }
                return model;
            }
            else
            {
                return null;
            }
        }

        /// <summary>
        /// 获得数据列表
        /// </summary>
        public static DataSet GetList(string strWhere)
        {
            StringBuilder strSql = new StringBuilder();
            strSql.Append("select *");
            strSql.Append(" FROM TB_CHECK_HS ");
            if (strWhere.Trim() != "")
            {
                strSql.Append(" where " + strWhere);
            }
            return DbHelperOra.Query(strSql.ToString());
        }
        /// <summary>
        /// 获得数据列表
        /// </summary>
        public static DataSet GetListForExport(string strWhere)
        {
            StringBuilder strSql = new StringBuilder();
            strSql.Append("select *");
            strSql.Append(" FROM V_CHECK_HS ");
            if (strWhere.Trim() != "")
            {
                strSql.Append(" where " + strWhere);
            }
            return DbHelperOra.Query(strSql.ToString());
        }
        /// <summary>
        /// 获得数据列表
        /// </summary>
        public static DataTable GetList(string strWhere, int startRecord, int maxRecords)
        {
            StringBuilder strSql = new StringBuilder();
            strSql.Append("select * ");
            strSql.Append(" FROM V_CHECK_HS ");
            if (strWhere.Trim() != "")
            {
                strSql.Append(" where " + strWhere);
            }

            return DbHelperOra.Query(strSql.ToString(), startRecord, maxRecords);
        }
        /*
        /// <summary>
        /// 分页获取数据列表
        /// </summary>
        public DataSet GetList(int PageSize,int PageIndex,string strWhere)
        {
            OracleParameter[] parameters = {
                    new OracleParameter(":tblName", OracleType.VarChar, 255),
                    new OracleParameter(":fldName", OracleType.VarChar, 255),
                    new OracleParameter(":PageSize", OracleType.Number),
                    new OracleParameter(":PageIndex", OracleType.Number),
                    new OracleParameter(":IsReCount", OracleType.Clob),
                    new OracleParameter(":OrderType", OracleType.Clob),
                    new OracleParameter(":strWhere", OracleType.VarChar,1000),
                    };
            parameters[0].Value = "TB_CHECK_HS";
            parameters[1].Value = "NID";
            parameters[2].Value = PageSize;
            parameters[3].Value = PageIndex;
            parameters[4].Value = 0;
            parameters[5].Value = 0;
            parameters[6].Value = strWhere;	
            return DbHelperOra.RunProcedure("UP_GetRecordByPage",parameters,"ds");
        }*/

        #endregion  Method
    }
}

